﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using MvcXamlController.Lib;
using MvcXamlController.Demo.Models;
using System.Windows.Controls;

namespace MvcXamlController.Demo.Controllers
{
    public class VisualsController : XamlAsyncController
    {
        //
        // GET: /Dashboard/

        public void ChartAsync()
        {
            var items=new List<Item>()
            {
                new Item{Name="Windows7", Region="US", SalesNo=100 },
                new Item{Name="Office2010", Region="US", SalesNo=70 },
                new Item{Name="Sharepoint", Region="US", SalesNo=20 },
            };

            StartRendering(viewModel: new {List=items});
        }

        public ActionResult ChartCompleted()
        {
            return XamlView();   
        }

        public void GuageAsync()
        {           
            ViewData["Score"]=200d;
            ViewData["Title"] = "Hello";
            StartRendering();
        }

        public ActionResult GuageCompleted()
        {
            return XamlView();
        }

        public void ButtonAsync()
        {
            StartRendering(()=>new Button() { Content="Hello",Height=30, Width=100 });
        }

        public ActionResult ButtonCompleted()
        {
            return XamlView();
        }





    }
}
